<template>
  <div class="ziliao">
    <wv-group title="使用手机号">
      <wv-input placeholder="请输入使用手机号" type="number" v-model="agentMobile" :maxlength="11"></wv-input>
    </wv-group>
    <wv-group title="使用说明及备注">
      <wv-textarea placeholder="请填写使用说明及备注" :rows="4" v-model="agentRemark"></wv-textarea>
    </wv-group>
    <p class="offer" @click="goPerfectAccountGoodsInfo()">提交</p>
  </div>
</template>

<script>
  import {agentPerfectAccountGoodsInfo} from '../../utils/http'
  import {Toast} from 'we-vue'

  export default {
    name: "subuseinfo",
    data() {
      return {
        accountGoodsId: '',
        agentMobile: '',
        agentRemark: ''
      };
    },
    methods: {
      goRecharge() {
        this.$router.push({path: '/rechargeorder', query: {rechargePrice: this.rechargePrice}});
      },
      goPerfectAccountGoodsInfo() {
        let params = {
          accountGoodsId: this.accountGoodsId,
          agentMobile: this.agentMobile,
          agentRemark: this.agentRemark
        };
        agentPerfectAccountGoodsInfo(params).then(res => {
          console.log(res)
          if (res.code == 100) {
            this.$router.back(-1)
          } else {
            Toast.text(res.info);
          }
        })
      }
    },
    created() {
      let query = this.$route.query;
      this.accountGoodsId = query.accountGoodsId;
    },
  }
</script>

<style scoped>
  .ziliao {
    padding-bottom: 50px;
  }

  .way .weui-cell_access {
    margin: 0 15px;
    padding: 15px 0;
    border-bottom: 1px solid transparent;
    text-align: left
  }

  .offer {
    position: fixed;
    bottom: 0;
    width: 100%;
    background-image: linear-gradient(to left, #4c92ed, #61beec);
    height: 50px;
    line-height: 50px;
    color: #fff;
  }
</style>
